<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>商品</el-breadcrumb-item>
      <el-breadcrumb-item>商品类型</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card class="box-card">
      <div class="clearfix">
        <i class="el-icon-tickets" style="margin-top: 10px;"></i>
        <span style="position: relative;" >数据列表</span>
        <el-button-group style="float: right; padding: 3px 0">
          <el-button type="info" size="mini" plain icon="el-icon-circle-plus-outline">添加</el-button>
        </el-button-group>
      </div>
    </el-card>
    <el-card class="box-card">
      <el-table
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column align="center"
                         prop="date"
                         label="日期"
                         width="180">
        </el-table-column>
        <el-table-column align="center"
                         prop="name"
                         label="姓名"
                         width="180">
        </el-table-column>
        <el-table-column align="center"
                         prop="address"
                         label="地址">
        </el-table-column>
        <el-table-column label="操作" align="center">
          <!--          scope所要操作的那一条数据对象-->
          <template slot-scope="scope">
            <el-button
              size="mini"
              @click="btnEdit(scope.$index, scope.row)">编辑</el-button>
            <el-button
              size="mini"
              type="danger"
              @click="btnDelete(scope.$index, scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    };
  }
};
</script>

<style scoped>
  .el-breadcrumb {
    font-size: 14px;
    line-height: 4;
  }
  .el-breadcrumb[data-v-321f4346] {
    font-size: 14px;
    line-height: 4;
    margin-left: 20px;
  }
  .el-card, .el-message {
    border-radius: 4px;
    overflow: hidden;
    margin-left: 20px;
  }
  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }
  .box-card {
    margin-top: 12px;
  }

</style>
